﻿using Kalman;
using Org.BouncyCastle.Cms;
using System;
using System.Collections.Generic;
using System.Text;

namespace QuDao
{
    /// <summary>
    /// 前端应用全局设置
    /// </summary>
    public partial class AppSettings
    {
        public static AppSettings Load()
        {
            var settings = AppConfig.Instance.GetSection<AppSettings>("AppSettings");
            //settings ??= GetDefault();
            return settings;
        }

        //private static AppSettings GetDefault()
        //{
        //    return new AppSettings
        //    {
        //        AppID = "",
        //        AppName = "",
        //        AppCode = "circle"
        //    };
        //}

        /// <summary>
        /// 应用ID
        /// </summary>
        public string AppID { get; set; }

        /// <summary>
        /// 应用名称
        /// </summary>
        public string AppName { get; set; }

        /// <summary>
        /// 应用代码
        /// </summary>
        public string AppCode { get; set; }

        /// <summary>
        /// 应用安全秘钥（用于API接口加密等场景，不是小程序的密钥）
        /// </summary>
        public string SecretKey { get; set; }

        /// <summary>
        /// 支付超时时间（单位：分钟）
        /// </summary>
        public int PaymentExpired { get; set; } = 30;

        /// <summary>
        /// IP地址白名单
        /// </summary>
        public string IPWhiteList { get; set; } = "::1,127.0.0.1";

    }
}
